package com.ebuilder.actions;

import com.ebuilder.beans.Person;
import com.ebuilder.services.PersonManagementService;
import com.ebuilder.services.PersonManagementServiceImpl;
import com.opensymphony.xwork2.ActionSupport;

public class ReadAction extends ActionSupport{

	private String userId;
	private String address;
	private String email;
	private int phone;
	
	public String execute() throws Exception {
		PersonManagementService ps = new PersonManagementServiceImpl();
		Person p = ps.getUser(userId);
		address = p.getAddress();
		email = p.getEmail();
		phone = p.getPhoneNumber();
		
		return SUCCESS;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getPhone() {
		return phone;
	}

	public void setPhone(int phone) {
		this.phone = phone;
	}
	
	
}
